Ext.define('Logisticext.common.CheckableTreePanel', {
    extend: 'Ext.tree.Panel',
    requires: [
        'Ext.data.TreeStore'
    ],
    xtype: 'check-tree',
    rootVisible: false,
    useArrows: true,
    autoLoad: false,
    listeners: {
        checkchange: function(node, checked, eOpts) {
            //当发生check变化时，如果是多层，则递归处理
            (function _check(child) {
                if (child.hasChildNodes()) {
                    child.eachChild(function(c) {
                        c.set('checked', checked);
                        _check(c);
                    });
                }
            })(node);
        }
    },
    initComponent: function() {
        this.callParent();
    }
});